package com.hanggold.intergration;

import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.event.EventListener;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO COMMENT.
 *
 * @author <a href="mailto:sunmch@163.com">smc</a>
 * @date 2021-08-11 17:11
 * @since 1.0.0
 **/
@RestController
@SpringBootApplication
public class MainApplication {
    
    public static void main(String[] args) {
        SpringApplication.run(MainApplication.class, args);
    }
    
    @RequestMapping("hello")
    public String hello(){
        return "helloworld";
    }
    
    @Bean
    public ApplicationRunner run() {
        return args ->{
            String[] arg = args.getSourceArgs();
            System.out.println(String.join("," ,arg));
        };
    }
    
    @EventListener
    public void listener(WebServerInitializedEvent webServerInitializedEvent){
        System.out.println("s");
    }
    
    
    
    
    
    
}
